const fs =require('fs');
const path = require('path')


var getFileByPath=function(f){
	return new Promise(function(resole,rej){
	fs.readFile(path.join(__dirname,f),'utf-8',(err,dataStr)=>{
	if(err) return rej(err)
	resole(dataStr)
})

});
	
}
getFileByPath('./files/2.txt').then(function(dataStr){
	console.log("****"+dataStr)
}
)